<template>
    <el-card shadow="always" :body-style="{ padding: '20px' }" v-loading="loading">
        <el-tabs v-model="currentTabs">
            <el-tab-pane label="资讯列表" name="data">
                <news-data></news-data>
            </el-tab-pane>
            <el-tab-pane label="资讯添加" name="add">
                <news-add></news-add>
            </el-tab-pane>
            <el-tab-pane label="资讯修改" name="edit" v-if="showEdit">
                <news-edit :form="editNews"></news-edit>
            </el-tab-pane>
        </el-tabs>
    </el-card>
    
</template>

<script>
import { mapState } from 'vuex'
import NewsAddVue from './NewsAdd.vue'
import NewsEditVue from './NewsEdit.vue'
import NewsTableVue from './NewsTable.vue'



export default {
    name:"News",
    data(){
        
    },
    computed: {
        ...mapState('an', [
            'editNews',
            'currentTabs',
            'loading',
            'showEdit'
        ])
    },
    components: {
        'news-data': NewsTableVue,
        'news-add': NewsAddVue,
        'news-edit': NewsEditVue,
    }
}
</script>